<%= form_for([@merchant_store, @form], html: {class: 'form-horizontal bootstrap-validate', role: 'form'}) do |f| %>
    <div class="form-group">
        <%= f.label :valid_from, '有效期起', class: 'col-sm-2 control-label' %>
        <div class="col-xs-6">
            <%= f.text_field(:valid_from, class: 'form-control datetimepicker', 'data-bv-notempty' => true) %>
        </div>
    </div>
    <div class="form-group">
        <%= f.label :valid_till, '有效期至', class: 'col-sm-2 control-label' %>
        <div class="col-xs-6">
            <%= f.text_field(:valid_till, class: 'form-control datetimepicker', 'data-bv-notempty' => true) %>
        </div>
    </div>
    关联支付计划
    <div class="table-responsive">
        <table class="table table-striped table-bordered table-hover">
            <thead>
            <tr>
                <th width="8%">关联</th>
                <th>支付计划ID</th>
                <th>类型</th>
                <th>适用银行</th>
                <th>适用用户</th>
            </tr>
            <% @payment_plans.each do |plan| %>
                <tr class="odd gradeX">
                <td><%= check_box_tag('merchant_transaction_rule[payment_plan_ids][]', plan.id, @form.payment_plan_ids.include?(plan.id)) %></td>
                <td><%= plan.id %></td>
                <td><%= plan_type_text(plan)%></td>
                <td><%= plan_bank_name(plan)%></td>
                <td><%= plan_user_type_text(plan)%></td>
            <% end %>
            </thead>
            <tbody>

            </tbody>
        </table>
    </div>
    <div class="form_footer">
        <a class="btn btn-default" href="<%= merchant_merchant_store_marketing_rules_path(@merchant_store) %>">返回</a>
        <button type="reset" class="btn btn-danger">重置</button>
        <button type="submit" class="btn btn-success"><i class="fa fa-check"></i> 提交</button>
    </div>
<% end %>

